var year_date = []
var month_date = []
var day_date = []

function yearDate() {
    //设置年份的选择
    var myDate = new Date();
    var startYear = myDate.getFullYear(); //起始年份
    for (var i = startYear - 50; i <= startYear; i++) {
        year_date.push(i)
    }
}

function monthDate() {
    for (var i = 1; i <= 12; i++) {
        month_date.push(i)
    }
}

function dayDate(year, month) { //选择月份的天数
    var d = new Date(year, month, 0);
    for (var i = 1; i <= d.getDate(); i++) {
        day_date.push(i)
    }
    return day_date
}


let myDate = new Date
let myYear = myDate.getFullYear() //获取当前年
let myMonth = myDate.getMonth() + 1 //获取当前月
let myDay = myDate.getDate() //获取当前日
if (myMonth < 10) {
    myMonth = '0' + myMonth
}
if (myDay < 10) {
    myDay = '0' + myDay
}
let myTime = myYear + '-' + myMonth + '-' + myDay //当前时间

let d = new Date(parseInt(Math.random() * 15 + 2006), parseInt(Math.random() * 11 + 1), 0) //当前月天数
let randomYear = parseInt(Math.random() * 3 + 2018)
let randomMonth = parseInt(Math.random() * 11 + 1)
let randomDay = parseInt(Math.random() * (d.getDate() - 1) + 1)
if (randomMonth < 10) {
    randomMonth = '0' + randomMonth
}
if (randomDay < 10) {
    randomDay = '0' + randomDay
}
let randomTime = randomYear + '-' + randomMonth + '-' + randomDay //随机时间